package com.sap.sap_mangers.Vo.ActivityLlkVo;

import com.sap.sap_mangers.pojo.ActivityLlk;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * 获取连连看排名的视图类
 *
 * @author ZhouKai
 * 2022/8/3 13:56
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ActivityLlkVo {
    /**
     * 排名
     */
    private Integer rank;
    /**
     * 用户学号
     */
    private String uid;
    /**
     * 用户名称
     */
    private String name;
    /**
     * 是否通关(消除所有方块)
     */
    private Boolean gameWin;
    /**
     * 得分
     */
    private Integer score;
    /**
     * 更新时间
     */
    private Timestamp updateTime;
    /**
     * 用时
     */
    private Integer time;

    /**
     * 生成排名视图类
     *
     * @param rank        排名
     * @param name        用户(真实)姓名
     * @param activityLlk 连连看活动记录
     */
    public ActivityLlkVo(int rank, String name, ActivityLlk activityLlk) {
        this.rank = rank;
        uid = activityLlk.getUid();
        this.name = name;
        this.gameWin = activityLlk.getGameWin();
        this.score = activityLlk.getScore();
        this.updateTime = activityLlk.getUpdateTime();
        this.time = activityLlk.getTime();
    }
}
